package com.tanhua.manager.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfig {

    /**
     *版本3.4.0以前
     */
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }

    /**
     * 版本3.4.0以后
     */

    //@Bean
    //public MybatisPlusInterceptor mybatisPlusInterceptor(){
    //    MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
    //    mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
    //    return mybatisPlusInterceptor;
    //}
}
